# Contributor: Kevin Daudt <kdaudt@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=apenwarr-redo
pkgver=0.42c
pkgrel=0
pkgdesc="Smaller, easier, more powerful, and more reliable than make"
url="https://redo.readthedocs.io/en/latest/"
arch="noarch"
license="Apache-2.0"
depends="python3"
makedepends="perl"
checkdepends="cpio"
subpackages="$pkgname-doc"
source="https://github.com/apenwarr/redo/archive/redo-$pkgver.tar.gz
	fix-env-python.patch
	"
provides="redo"
provider_priority=50

builddir="$srcdir/redo-redo-$pkgver"

build() {
	./do build
}

check() {
	# Causes issues with the test suite
	unset CC CPPFLAGS CFLAGS CXX CXXFLAGS LDFLAGS
	./do test
}

package() {
	DESTDIR="$pkgdir" PREFIX="/usr" ./do install
}

cleanup_srcdir() {
	# Test suite changes some files to read-only, resulting in errors on
	# cleanup.
	[ -e "$srcdir" ] && chmod -R a+w "$srcdir"

	default_cleanup_srcdir
}

sha512sums="764ef84cfb56d5dd883cf80f706a567491e1a679d136219c4db3c122386aad3cfbd28131dc231a91639f596d7b8819c4254e4e7fa38f917996ca8bf3e1a5dc19  redo-0.42c.tar.gz
8b01a70e0812bf6c90c8447d110eac91639c35e3e3c20a083d4ed68fe0b3a3524081ad94fa1fd504525b7ebf5ef1fd5aff9fe3b933fe9f0aa2a404426ed96471  fix-env-python.patch"
